{include file="./header"  title="广告编辑" /}
<div class="container-fluid">
<form action="" method="post" enctype="multipart/form-data">
    <table class="table table-hover">
  <thead>
  <tr>
    <th>名称</th>
    <th>编辑</th>
    <th>说明</th>
  </tr>
  </thead>
  
  
  <tr class="form-group">
    <td><label for="name">广告名称</label></td>
    <td><input name="name" type="text" class="form-control" id="name" value="{$sql.name|default=""}" /></td>
    <td>广告名称</td>
  </tr>
  {present name="$sql.id"}
  <tr class="form-group">
    <td><label for="tab">前台标签</label></td>
    <td>{literal}{bb:ad id='{/literal}{$sql.id}{literal}'/}{/literal}</td>
    <td>获取前台使用的标签</td>
  </tr>
  {/present}
  
  <tr class="form-group">
    <td><label for="value">广告代码</label></td>
    <td><textarea name="value" rows="3" class="form-control" id="value">{$sql.value|default=""}</textarea></td>
    <td>广告代码</td>
  </tr>
  <tr>
  	<td>广告预览</td>
  	<td colspan="2">{$sql.value|default=""|raw}</td>
    </tr>
  <tr class="form-group">
    <td><label for="start_time">开始时间</label></td>
    <td>
    <input name="start_time" type="date" class="form-control" id="start_time" value="{$sql['start_time']?date('Y-m-d',$sql['start_time']):date('Y-m-d')}" > 
    </td>
    <td>开始时间</td>
  </tr>
  
  <tr class="form-group">
    <td><label for="end_time">结束时间</label></td>
    <td>
    <input name="end_time" type="date" class="form-control" id="end_time" value="{$sql['end_time']?date('Y-m-d',$sql['end_time']):date('Y-m-d',time()+2592000)}" > 
    </td>
    <td>结束时间</td>
  </tr>
  
  
  <tr class="form-group">
    <td><label for="status">状态</label></td>
    <td>
        <input type="radio" name="status" value="1" {:empty($sql['status'])?'':'checked="checked"'}>开启
        <input type="radio" name="status" value="0" {:empty($sql['status'])?'checked="checked"':''}>关闭
    </td>
    <td>&nbsp;</td>
  </tr>
  
  <tr class="form-group">
    <td>
    <input type="submit" class="btn btn-default" id="button" value="提交" />
    <button type="button" onClick="javascript:history.back(-1);" class="btn btn-default">返回</button>
    </td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
    </form>
</div>
{include file="./footer" /}